cmake_minimum_required(VERSION 3.8)
project(ros2_c++_node.cpp)
add_executable(ros2_cpp ros2_c++_node.cpp)
find_package(rclcpp REQUIRED) # 查rclcpp中获取头文件及库文件

message(STATUS ${rclcpp_INCLUDE_DIRS}) # 头文件及rclcpp的头文件
message(STATUS ${rclcpp_LIBRARIES})

target_include_directories(ros2_cpp PUBLIC ${rclcpp_INCLUDE_DIRS})
target_link_libraries(ros2_cpp ${rclcpp_LIBRARIES}) # 链接库文件
